<!DOCTYPE html>
<!-- saved from url=(0061)file:///C:/Users/FIGO/Desktop/%E8%BD%A6%E9%99%A9/exc/edf.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>菜鸟教程(runoob.com)</title>
<!-- <style>
	form label:first-child{color:red;}


</style> -->
<!-- <style type="text/css"></style> -->
<link rel="stylesheet" type="text/css" href="./菜鸟教程(runoob.com)_files/edf.css">
</head>
<body>
	<h1>功率运算表</h1>
<form>
		<label for="rl1">电流：</label>
		<input type="text" id="rl1"><br><br>
		<label for="rl2">电阻：</label>
		<input type="text" id="rl2"><br><br>
		<label for="rl3">时间：</label>
		<input type="text" id="rl3"><br><br>
		<label id="sul">功率：2880</label><br><br>
		<input type="button" id="btn" value="计算">

</form>
<!-- <script type="text/javascript" scr="edf.js"></script> -->
<script type="text/javascript">
	
var Q ;
var ElectricCurrent = document.getElementById("rl1");
var EC = 0;
EC = ElectricCurrent.value;
var Resistance = document.getElementById("rl2");
var R;
var time = document.getElementById("rl3");
var t;
var btn = document.getElementById("btn");
var sul = document.getElementById("sul")

btn.onclick = function(){
	EC=ElectricCurrent.value;
	R = Resistance.value;
	t = time.value;

Q = EC**2*R*t;
sul.innerText = "功率：" + Q;
};

</script>

</body></html>